package com.itheima.work;
/*6、【编号：1007】结合继承的思想，分析下列需求并实现
        定义项目经理类Manager 【属性：姓名 工号 工资 奖金】【行为：工作work】
        定义程序员类Coder【属性：姓名 工号 工资】【行为：工作work】
        要求：通过有参构造创建两个类的对象，并调用各自的work方法
        运行结果：
        姓名为:张三,工号为:9527,工资为:10000.0,的程序员正在编写代码
        姓名为:李四,工号为:9528,工资为:15000.0,奖金为:2000.0,的项目经理正在管理程序员写代码*/
public class Demo06 {
    public static void main(String[] args) {
        coder c =new coder("张三","9527",10000.0);
        c.work();
        Manager m =new Manager("李四","9528",10000.0,2000.0);
        m.work();
    }
}
class coder{
    private String name;
    private String num;
    private double gongzi;

    public coder() {
    }
    public coder(String name, String num, double gongzi) {
        this.name = name;
        this.num = num;
        this.gongzi = gongzi;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public double getGongzi() {
        return gongzi;
    }

    public void setGongzi(double gongzi) {
        this.gongzi = gongzi;
    }
    public void work(){
        System.out.println(this.name + ",工号为:"+this.num +
                ",工资为:" +this.gongzi +"的的程序员正在编写代码" );
    }
}
class Manager extends coder{
    private double jin;
    public Manager(){}
    public Manager(String name,String num ,double gongzi,double jin  ){
        super(name,num,gongzi);
        this.jin =jin;
    }
    public void work(){
        System.out.println(super.getName()+",工号为:" +super.getNum()
                +",工资为:"+super.getGongzi()+
                ",奖金为:"+this.jin+"的项目经理正在管理程序员写代码");
    }
}